package com.rc.web.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.rc.pojo.po.QuestionOption;
import com.rc.web.mapper.QuestionOptionMapper;
import com.rc.web.service.QuestionOptionService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 问题选项服务实现类
 * 提供问题选项相关的业务逻辑实现
 */
@Service
public class QuestionOptionServiceImpl extends ServiceImpl<QuestionOptionMapper, QuestionOption> implements QuestionOptionService {

    /**
     * 根据问题ID列表获取选项
     * @param questionId 问题ID列表
     * @return 问题选项列表
     */
    @Override
    public List<QuestionOption> getByQuestionId(List<Long> questionId) {
        return mapper.selectByQuestionId(questionId);
    }

    /**
     * 根据问题ID删除选项
     * @param questionId 问题ID
     */
    @Override
    public void deleteByQuestionId(Long questionId) {
        mapper.deleteByQuestionId(questionId);
    }

    /**
     * 根据植物ID和病虫害ID删除选项
     * @param plantId 植物ID
     * @param illId 病虫害ID
     */
    @Override
    public void deleteByPlantId(Long plantId, Long illId) {
        mapper.deleteByPlantId(plantId, illId);
    }
}
